package com.lin.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 控制器
 */
@Controller
@RequestMapping("/user")
public class HelloController {
    /**
     * RequestMapping注解的属性
     * method = RequestMethod.POST 不能访问到只能是get请求
     * params = "username" 客户端必须传一个username的参数才可以
     * headers="accept" 请求体中必须要有的头
     * @return
     */
    @RequestMapping(path = "/hello",params = "username")
    public String hello(){
        System.out.println("hello---SpringMVC");
        return "success";
    }
}
